Skip to content

[muse] fix(server): recompute checkpoint turn count after slow git capture - #5

Open
kvnloo wants to merge 1 commit into
mainfrom
muse/checkpoint-turncount-collision
Open

kvnloo wants to merge 1 commit into
mainfrom
muse/checkpoint-turncount-collision

Conversation

@kvnloo

@kvnloo kvnloo commented Sep 28, 2026

Copy link
Copy Markdown
Owner

What Changed

The decider now rejects thread.turn.diff.complete when another turn already owns the submitted checkpoint turn count, and the CheckpointReactor re-reads checkpoint context after the slow git capture, re-capturing at a fresh count when a concurrent turn claimed it first.

Why

Two turns racing turn completion could both compute max(count)+1 and share a checkpointTurnCount, colliding on the deterministic git ref.

Validation

  • decider.turnDiffComplete 5/5 green (red-on-base: 1 failed, 4 passed).
  • CheckpointReactor 46/46 green including a new race test that fails on base (turn-1 lands at count 1, colliding with turn-2's placeholder).

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • No UI changes

Authored with AI assistance (Muse, Meta's Muse Spark) under the contributor's direction.

…pture

Two turns racing turn completion could both compute max(count)+1 and
share a checkpointTurnCount, colliding on the deterministic git ref.
The decider now rejects thread.turn.diff.complete when another turn
already owns the submitted count, and the reactor re-reads checkpoint
context after the slow git capture, re-capturing at a fresh count when
a concurrent turn claimed it first.

Tests: decider.turnDiffComplete 5/5 green (red-on-base: 1 failed, 4
passed); CheckpointReactor 46/46 green including a new race test that
fails on base (turn-1 lands at count 1, colliding).

Authored with AI assistance (Muse, Meta's Muse Spark) under the
contributor's direction.
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L labels Sep 28, 2026
@kvnloo kvnloo added the keep pr-janitor: never auto-close label Oct 17, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

keep pr-janitor: never auto-close size:L vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant